﻿@namespace MudBlazor.Docs.Examples

@inject ISnackbar Snackbar

<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@Show">
    Open clickable snackbar
</MudButton>

@code {

    void Show()
    {
        Snackbar.Add("I got a message for you", Severity.Normal, config =>
        {
            config.OnClick = snackbar =>
            {
                SayHello();
                return Task.CompletedTask;
            };
        });
    }

    public void SayHello()
    {
        Snackbar.Add("Hello World!");
    }
}
